<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>博客添加-修改</title>
		<link rel="stylesheet" href="css/layui.css" media="all">
		<link rel="stylesheet" href="css/modules/layer/default/layer.css" />
		<script src="js/layui.js"></script>
		<script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
		<script src="js/lay/modules/layer.js"></script>
		<script type="text/javascript" src="js/lay/modules/form.js"></script>
		<script charset="utf-8" src="kindeditor/kindeditor-all-min.js"></script>
		<script charset="utf-8" src="kindeditor/lang/zh-CN.js"></script>
		<script type="text/javascript" src="js/angularJS/angular.min.js"></script>
		<script type="text/javascript" src="js/base.js"></script>
		<script type="text/javascript" src="js/service/blogTypeService.js"></script>
		<script type="text/javascript" src="js/service/blogService.js"></script>
		<script type="text/javascript" src="js/controller/baseController.js"></script>
		<script type="text/javascript" src="js/controller/blogController.js"></script>
	</head>

	<body ng-app="blogManager" ng-controller="blogController" ng-init="findAllType()">
			<form class="layui-form" action="blog.html" method="get">
				<div class="layui-form-item">
					<label class="layui-form-label">博客标题</label>
					<div class="layui-input-block">
						<input type="text" id="title" required lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">浏览数</label>
					<div class="layui-input-inline">
						<input type="text" id="clicknum" required lay-verify="required" autocomplete="off" class="layui-input">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">评论数</label>
					<div class="layui-input-inline">
						<input type="text" id="replynum" required lay-verify="required" autocomplete="off" class="layui-input">
					</div>
				</div>
				<div >
					<label class="layui-form-label">所属类别</label>
					<div >
						<select ng-options="x.typeId as x.typename for x in blogTypeList" ng-model="entity.typeid">
						</select> 
					</div>
				</div> 
				<div class="layui-form-item">
					<div class="layui-input-block">
						<textarea id="editor_id" name="content" style="width:900px;height:300px;">
							&lt;strong&gt;请输入内容&lt;/strong&gt;
						</textarea>
					</div>
				</div>
				
				<div class="layui-form-item">
					<div class="layui-input-block">
						<button class="layui-btn" ng-click="save()" lay-submit lay-filter="formDemo">保存</button>
						<button type="reset" class="layui-btn layui-btn-primary">重置</button>
					</div>
				</div>
			</form>

<!-- 			<div>
				<select>
					<option value="{{pojo.typeId}}" ng-repeat="pojo in blogTypeList">{{pojo.typename}}</option>
				</select>
			</div>
 -->
		<script>
			KindEditor.ready(function(K) {
				window.editor = K.create("#editor_id",{
					filePostName:"uploadFile",
					uploadJson :"./blog/upload.do"
				});
				
				// 取得HTML内容
				//html = editor.html();

				// 同步数据后可以直接取得textarea的value

			});
			function getHtml() {
				editor.sync();
				var value = document.getElementById('editor_id').value;
				alert(value);
			}
		</script>
	</body>

</html>